package com.wdy.async.method.invocation;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;

/**
 * @ClassName: AsyncExecutor
 * @Description: TODO
 * @Date: 2019/12/30 15:49
 * @Author: wangdy001
 * @Version: 1.0
 */
public interface AsyncExecutor {
    <T> AsyncResult<T> startProcess(Callable<T> callable);

    <T> AsyncResult<T> startProcess(Callable<T> callable, AsyncCallback<T> asyncCallback);

    <T> T endProcess(AsyncResult<T> asyncResult) throws InterruptedException, ExecutionException;
}
